//define(function(require,exports,module){
    angular.module('mineApp')
         .controller('YieldCtrl',["$scope","$http","$window", function ($scope,$http,$window) {
            //head
            $scope.back = '<a href="#/"><i class="icon-font" title="返回">&#xe61f;</i>返回</a>';
            $scope.next = '<a href="index.html" target="_self">首页</a>';

            $scope.draw = function(precent,level){
                var _precent =precent ||0.5,
                    _level = level || 3;
                var canvas =document.getElementById("js_convas");
                  if(canvas.getContext){
                      //获取对应的CanvasRenderingContext2D对象(画笔)
                      var ctx = canvas.getContext("2d");
                      ctx.beginPath();
                      //设置弧线的颜色为蓝色
                      ctx.strokeStyle = "#d37667";
                      ctx.lineWidth = 2;
                      ctx.arc(125,125,120,Math.PI*0.8,Math.PI*0.2,false);
                      ctx.stroke();
                      //进度条
                      ctx.beginPath();
                      ctx.strokeStyle = "#f8e71c";
                      ctx.lineWidth = 6;
                      //百分比0-1
                      ctx.arc(125,125,120,Math.PI*0.8,Math.PI*(1.4*_precent+0.8),false);

                      ctx.stroke();
                      //vip等级
                      ctx.font = "12px Arial";
                      //设置字体填充颜色
                      ctx.fillStyle = "#f6a598";
                      //从坐标点(50,50)开始绘制文字
                      ctx.fillText("V"+_level, 5, 200);
                      ctx.fillText("V"+(_level+1), 230, 200);
                      //先关闭绘制路径。注意，此时将会使用直线连接当前端点和起始端点
                      ctx.closePath();
                  }
            }();

        }]);
//})